module.exports = {
   /*
  ** Router config
  */
  router: {
    middleware: 'auth',//在每页渲染前运行 middleware/auth.js 中间件的逻辑
    fallback:false,
    //mode: 'hash',//路由方式使用hash路由
  },
  /*
  ** Headers of the page
  */
  head: {
    title: 'vue-nuxt',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'Nuxt.js project' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'styleSheet', href: '/static/ace/css/ace.css' },
      { rel: 'styleSheet', href: '/static/ace/css/bootstrap.css' },
    ],
    script:[
      {
        src:"/static/ace/compatible.js"
      },
      {
        src:"/static/ace/js/jquery1x.js"
      },
     {
        src:"http://api.map.baidu.com/api?v=2.0&ak=3GEIYwhwIw0aKcaFOKpsDiOAWsoDAVam"
      },
      {
        src:"/static/ace/js/bootstrap.js"
      },
      {
        src:"/static/ace/js/ace.js"
      }
    ]
  },
  /*
  ** Customize the progress bar color
  */
  loading: { color: '#3B8070' },

  //本地运行环境路径
  env: {
    baseUrl: process.env.BASE_URL || 'http://localhost:3000',
  },
  //全局的css引入文件
  css:[],
  //引入插件
  //plugins: ['~plugins/http/useHttp'],
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLint on save
    */
    publicPath: 'http://oecom.cn:8080/static/',
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        },
        {
          test: /\.(css?|less)?$/,
          loader: ['style-loader','css-loader', 'less-loader','postcss-loader'],
        })
      }
    }
  }
}
